package singleton;

/**
 * @Author buyee
 * @Date 2022/7/4 下午7:31
 */
public class SingleTonExample {
    private static volatile SingleTonExample singleTonExample = null;

    public static SingleTonExample getSingleTon() {
        if (singleTonExample == null) {
            synchronized (SingleTonExample.class) {
                if (singleTonExample == null) {
                    singleTonExample =  new SingleTonExample();
                }
            }
        }

        return singleTonExample;
    }
}
